import { defineStore } from 'pinia'
import { ref } from 'vue'

export default defineStore('driverId', () => {
    const driverId = ref<number | null>(null)
    const setDriverId = (val: number) => (driverId.value = val)
    return { driverId, setDriverId }
  },
  {
    persist: {
      storage: {
        getItem: (key) => uni.getStorageSync(key),
        setItem: (key, value) => uni.setStorageSync(key, value),
      },
    },
  },
)
